// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class DataframeAnalysisAnalyzedFields
{
	/// <summary>
	/// <para>
	/// An array of strings that defines the fields that will be included in the analysis.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("excludes")]
	public ICollection<string> Excludes { get; set; }

	/// <summary>
	/// <para>
	/// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.
	/// </para>
	/// </summary>
	[JsonInclude, JsonPropertyName("includes")]
	public ICollection<string> Includes { get; set; }
}

public sealed partial class DataframeAnalysisAnalyzedFieldsDescriptor : SerializableDescriptor<DataframeAnalysisAnalyzedFieldsDescriptor>
{
	internal DataframeAnalysisAnalyzedFieldsDescriptor(Action<DataframeAnalysisAnalyzedFieldsDescriptor> configure) => configure.Invoke(this);

	public DataframeAnalysisAnalyzedFieldsDescriptor() : base()
	{
	}

	private ICollection<string> ExcludesValue { get; set; }
	private ICollection<string> IncludesValue { get; set; }

	/// <summary>
	/// <para>
	/// An array of strings that defines the fields that will be included in the analysis.
	/// </para>
	/// </summary>
	public DataframeAnalysisAnalyzedFieldsDescriptor Excludes(ICollection<string> excludes)
	{
		ExcludesValue = excludes;
		return Self;
	}

	/// <summary>
	/// <para>
	/// An array of strings that defines the fields that will be excluded from the analysis. You do not need to add fields with unsupported data types to excludes, these fields are excluded from the analysis automatically.
	/// </para>
	/// </summary>
	public DataframeAnalysisAnalyzedFieldsDescriptor Includes(ICollection<string> includes)
	{
		IncludesValue = includes;
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
		writer.WriteStartObject();
		writer.WritePropertyName("excludes");
		JsonSerializer.Serialize(writer, ExcludesValue, options);
		writer.WritePropertyName("includes");
		JsonSerializer.Serialize(writer, IncludesValue, options);
		writer.WriteEndObject();
	}
}